#ifndef STATE_H
#define STATE_H
#include <QMap>
#include "Macros.h"

class State
{
public:
    State(){}
    ~State(){}

public:
    void iniData(int x, int y)
    {
        m_x = x;
        m_y = y;
        m_index = ROOM_WIDTH * x + y;
    }

    void actRandom(int &dir, int &nexti)
    {
        int dirsize = m_transfer.size();
        int select = rand() % dirsize;
        auto it = m_transfer.begin() + select;
        dir = it.key();
        nexti = it.value();
    }

public:
    int m_x;
    int m_y;
    int m_index;
    char m_tile;

    QMap<int, int> m_transfer; //action and next index
};

#endif // STATE_H
